<div id='uploaderComponent' class="uploader" data-ride="uploader" style="display: none;margin-bottom: 0;">
    <div class="uploader-message text-center">
        <div class="content"></div>
        <button type="button" class="close">×</button>
    </div>
    <div id="file-grid" style="height: 325px;overflow: auto;"
    class="uploader-files file-list file-list-lg" data-drag-placeholder="请拖拽文件到此处"></div>
    <div class="uploader-actions">
        <div class="uploader-status pull-right text-muted"></div>
        <button type="button" class="btn btn-link uploader-btn-browse"><i class="icon icon-plus"></i> 选择文件</button>
        <button type="button" class="btn btn-link uploader-btn-start"><i class="icon icon-cloud-upload"></i> 开始上传</button>
    </div>
</div>
<script>
    // 获取upload对象
    //let uploader = $('#uploaderComponent').data('zui.uploader');
    $('#uploaderComponent').uploader({
        url:'/mukeUpload!uploadFile',
        chunk_size:'5000mb',
        multipart_params:function (file,params) {
            return {folderId:currentFolderId};
        },
        deleteActionOnDone: function (file, doRemoveFile) {
            doRemoveFile();
        },
        responseHandler:function (responseData,file) {
            let msg = JSON.parse(responseData.response)
            if (msg === 'error'){
                return '文件上传失败';
            } else {
                // 刷新表格数据
                let table = layui.table;
                table.reload('fileTable',{
                    url:'/userFile!queryFileList',
                    where:{
                        parentFolderId:currentFolderId
                    },
                    page:{
                        curr:1
                    }
                });
            }
        }
    });
</script>
